When you run Eleventy, it processes your .md files and builds the _site folder in a strict sequence:
- Read Configuration (Docs: Configuration)
Eleventy loads
eleventy.config.jsfirst to check your input/output directories (srcand_site), passthrough copy rules, filters, and plugins. - Copy Static Assets (Docs: Passthrough File Copy)
Anything registered with
addPassthroughCopy(likeimg,css, andadmin) is copied directly into_sitewithout modification. - Load Global Data (Docs: Global Data Files)
Eleventy reads all files inside
_data/(likesite.js) and makes their exported values globally available to every template. - Scan and Map Files (Docs: Permalinks & Input/Output Directories)
Eleventy scans
src/for template files (.md,.njk,.html), ignoring_includesand_data, and calculates each page's output URL (e.g.,src/about.mdmaps to_site/about/index.html). - Merge the Data Cascade (Docs: Data Cascade)
For each
.mdfile, Eleventy combines data from lowest to highest priority:
- Global data (
_data/) - Directory data files (e.g.,
posts/posts.json) - Template data files (e.g.,
about.json) - The file's own YAML front matter (highest priority)
- Build Collections (Docs: Collections)
Eleventy inspects the merged
tagson every page and groups matching pages intocollections(such ascollections.post). - Render Markdown to HTML (Docs: Template Languages — Markdown)
Eleventy processes any Nunjucks/Liquid tags inside the
.mdbody first, then runs the Markdown parser (markdown-it) to convert the Markdown syntax into raw HTML fragments. - Wrap in Layouts (Docs: Layouts & Layout Chaining)
Eleventy looks at the
layoutvariable (likelayout.njk), injects the converted HTML fragment into{{ content | safe }}, and repeats this step if layouts are chained together. - Write Final Files (Docs: Transforms & Events)
Eleventy runs any post-processing transforms (such as HTML minifiers) and writes the finished HTML files to
_site/.